package cn.tedu.sp09.feign;


import cn.tedu.sp01.pojo.Item;
import cn.tedu.sp01.pojo.User;
import cn.tedu.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
//调用向eureka注册的item-service服务器
@FeignClient(name="user-service",fallback =UserClientFB.class)//降级类
public interface UserClient {

    @GetMapping("/{userId}")//调用item-service服务器中的"/{orderId}"这个请求业务
    JsonResult<User> getUser(@PathVariable Integer userId);
    @GetMapping("/{userId}/score")
    JsonResult<?> addscore(@PathVariable Integer userId, @RequestParam Integer score);

}
